//
//  CMDBUserCenterPhotoLibraryCell.swift
//  CMDB
//
//  Created by 曹桂祥 on 2017/5/22.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

class CMDBUserCenterPhotoLibraryCell: CMDBBaseCollectionViewCell {

    var coverImageView : UIImageView!
    
    var libraryNameLabel : UILabel!
    
    var libraryUpdateTimeLabel : UILabel!
    
    var libraryBean : CMDBAlbumsBean? {
        
        didSet{
            
            guard let libraryBean = libraryBean else { return }
            
            libraryNameLabel.text       = libraryBean.name
            
            libraryUpdateTimeLabel.text = libraryBean.lastTime
            
            coverImageView.image        = UIImage(named: "相册背景图")
            
        }
        
    }

}

extension CMDBUserCenterPhotoLibraryCell{
    
    override func setupCollectionCell() {
        super.setupCollectionCell()
    }
    
    override func buildCollectionCell() {
        super.buildCollectionCell()
        
        coverImageView         = UIImageView()
        
        coverImageView.frame   = CGRect(x: 0, y: 0, width: width, height: width)

        contentView.addSubview(coverImageView)

        libraryNameLabel       = UILabel(strColor: word87Color, string: "新建相册", strFont: CMDB_13_FONT)
        
        contentView.addSubview(libraryNameLabel)
        
        libraryNameLabel.frame = CGRect(x: 0, y: CGRectGetMaxY(coverImageView.frame) + 5, width: width, height: 15)
        
        libraryUpdateTimeLabel = UILabel(strColor: word38Color, string: "更新于05月20日", strFont: CMDB_10_FONT)
        
        contentView.addSubview(libraryUpdateTimeLabel)
        
        libraryUpdateTimeLabel.frame = CGRect(x: 0, y: CGRectGetMaxY(libraryNameLabel.frame) + 3, width: width, height: 20)
        
    }
    
}
